-- GENERATED SPELL FOR [Illidari Shadowlord] --


function spell0_22988(pUnit, Event) --@Carrion Swarm,n/a--
pUnit:FullCastSpellOnTarget(39942,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22988', 555, 1)
end

function spell1_22988(pUnit, Event) --@Inferno,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(39941,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_22988', 1, 1)
end

function spell2_22988(pUnit, Event) --@Sleep,n/a--
pUnit:FullCastSpellOnTarget(12098,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22988', 21000, 1)
end

function Sorts_22988(pUnit, Event)
local choix_sorts_22988 = math.random(0, 2)
if choix_sorts_22988 == 0 then
pUnit:RegisterEvent('spell0_22988', 1, 1)
end
if choix_sorts_22988 == 1 then
pUnit:RegisterEvent('spell1_22988', 1, 1)
end
if choix_sorts_22988 == 2 then
pUnit:RegisterEvent('spell2_22988', 1, 1)
end
end

function mob22988_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22988', math.random(1500, 3000), 1)
end

function mob22988_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22988_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22988_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22988, 1, 'mob22988_Action')
RegisterUnitEvent(22988, 2, 'mob22988_Leave')
RegisterUnitEvent(22988, 3, 'mob22988_Kill')
RegisterUnitEvent(22988, 4, 'mob22988_Die')
